1. Field of the Invention
The present invention relates to an exponential calculation device and a decoding device for performing a predetermined calculation for a given encoded bit stream. More particularly, the present invention relates to an exponential calculation device for calculating x (a/b) and a decoding device for calculating x (a/b)*2 (y/c) for given integer values x and y contained in a bit stream which has been encoded based on the MPEG (moving picture experts group) 2 audio encoding standard "AAC".
2. Description of the Related Art
Conventionally, in order to calculate z=x (a/b) for a given value of x (where a and b are constant values), values of x (a/b) for all the possible values of x are stored in a table whose addresses are associated with the respective values of x. The value of z for a given value of x is obtained by reading out the value stored in the table.
In this specification, "x to a power of (a/b)" is represented as "x (a/b)", where the symbol " " denotes the use of an exponential function, and the symbol "/" denotes a division function. The symbol"*" will also be used herein to denote a multiplication function.
FIG. 27 illustrates a table containing values of x (4/3) for values of x in a range of 0.ltoreq.x.ltoreq.8191. A decoding operation based on the MPEG 2 audio encoding standard AAC requires calculation of x (4/3) for a value of x in the range from 0 to 8191. When the conventional method of obtaining the value of x (a/b) is employed in the exponential calculation involved in decoding data encoded based on the MPEG 2 audio encoding standard AAC, an input value of x is used as an address for reading out the corresponding value from a table provided in advance, as illustrated in FIG. 27, to obtain the value of x (4/3) an output value z.
In order to decode an encoded bit stream so as to obtain the intended data, it is necessary to perform a predetermined calculation process. A bit stream encoded based on the MPEG 2 audio encoding standard AAC contains a quantization code "x" and a scaling factor "y". The quantization code "x" and the scaling factor "y" are both integers. In the case of the MPEG 2 audio encoding standard AAC, the decoding device calculates x (a/b)*2 (y/c) (where a,b and c are constants) for given values of x and y. Details of the MPEG 2 audio encoding standard AAC are disclosed in ISO/IEC 13818-7:1997, pp.57-59.
Conventionally, an operation of calculating x (a/b)*2 (y/c) for given values of x and y has been performed as follows with a DSP (digital signal processor) of a fixed point format.
FIG. 28 illustrates an exemplary 32-bit fixed point format. Referring to FIG. 28, where the bit 0 is the least significant bit and the bit 31 is the most significant bit, the decimal point is fixed between the bit 30 and the bit 29. In particular, bit 30 represents the integral portion of a value, while the bits 29-0 represent the fractional portion of the value. Bit 31 is the sign bit indicating whether the value is positive or negative. Such a numeric representation with a fixed decimal point is called a "fixed point format".
For example, a value "f" represented in the 32-bit fixed point format, as illustrated in FIG. 28, can vary in the range of -2.ltoreq.f&lt;2. Then, in order to perform a calculation with a fixed-point-format processing unit, such as a DSP, values involved in the calculation are adjusted so that they are each in the range of .+-.2.0 before performing the intended calculation.
In the MPEG 2 audio encoding standard AAC, x can vary in the range of 0.ltoreq.x&lt;8192, whereas y can vary in the range of -100.ltoreq.y&lt;156. Consider a calculation of Expression (1) below for x and y having such ranges. EQU x (4/3)*2 (y/4) (1)
Expression (1) may be calculated as follows based on the prior art technique with a fixed-point-format processing unit. First, Expression (1) is converted to Expression (2) below. EQU x (4/3)*2 ((y%4)/4)*2 int(y/4) (2)
In Expression (2), "(y%4)" represents a remainder of a division y/4, and "int(y/4)" represents a quotient (integer) of the division y/4. In the calculation of Expression (2), x (4/3) is first calculated. The calculation x (4/3) is typically performed using a ROM table. In particular, values of x (4/3) for various values of x are calculated and stored in a table in advance. Then, the value of x (4/3) for a given value of x is obtained by referencing the ROM table using the value of x as the address of the table.
The calculation of Expression (1) or (2) assumes the use of a fixed-point-format processing unit. In particular, different values of x (4/3) are normalized and stored in a table in advance, with the maximum value thereof being normalized to a value which does not exceed 1.0.
FIG. 29 illustrates the contents of a first table for use with a conventional decoding device. The table illustrated in FIG. 29 contains values of f(x) for the range of 0.ltoreq.x&lt;8192 at addresses which correspond to the respective values of x. The values of f(x) are obtained by first calculating x (4/3) for various values of x, and then dividing the calculated values by 2 18 to normalize the values so that none of them exceeds 1.0.
In the calculation of Expression (2), 2 ((y%4)/4) is then calculated. Typically, 2 ((y%4)/4) is also calculated using a ROM table. In particular, different values of 2 ((y%4)/4) for various integers (y%4) are calculated and stored in a table in advance. Then, an integer (y%4) is used as an address for referencing the table so as to obtain the value of 2 ((y%4)/4) for the integer (y%4).
FIG. 30 illustrates the contents of a second table for use with a conventional decoding device. The second table illustrated in FIG. 30 contains values of g(y) for the address values (y%4) in the range from 0 to 3. The values of g(y) are obtained by normalizing values of 2 ((y%4)/4) so that none of them exceeds 2.0.
After such a table is provided, the value of Expression (2) can be obtained. First, the first table illustrated in FIG. 29 is referenced using an input integer x as an address so as to obtain the normalized value f(x) for x (4/3). Then, (y%4) is calculated for a given integer of y. Subsequently, the calculated value of (y%4) is used as an address to obtain a value of g(y)=2 ((y%4)/4) from the second table illustrated in FIG. 30. Then, a multiplier is used to calculate f(x)*g(y) so as to obtain a multiplied value f(x)*g(y)=h(x,y). Since the obtained value f(x) is within the range of .+-.1 while the obtained value g(y) is within the range of .+-.2, the multiplication result h(x,y) should always has a value in the range of .+-.2.
Then, h(x,y) is multiplied by 2 int(y/4) so as to obtain a multiplied value i(x,y) as a calculation result of Expression (2). The multiplication can be performed by a bit shift operation. In the bit shift operation, it is assumed that a limit operation (so called a "clipping operation") is performed when the final calculation result exceeds the range of .+-.2. Thus, in the prior art, the calculation i(x,y)=x (4/3)*2 (y/4) is performed using a large-capacity table.
Use of the above conventional method for obtaining a value of x (a/b) requires a large memory area for the table containing different values of x (a/b). For example, assuming that the stored values of x (a/b) are 32-bit fixed point values, the table illustrated in FIG. 27 would require a memory area of 32 K bytes. Thus, when x has a wide variable range, large-scale hardware has to be employed for the large memory area required.
Moreover, in the conventional method of calculating x (a/b)*2 (y/c), the number of significant digits of the calculated value f(x) is undesirably small for relatively small input integers of x, as those in the upper portion of FIG. 29. For example, the value f(x) corresponding to address x=2 uses only the lower 14 bits of the 32 bits that are available. Thus, a calculation performed by using such a table results in a poor accuracy in the calculation result. Moreover, the conventional calculation method employs a wide range of x (i.e., 0-8191), and accordingly requires a memory area as large as 8191*32 bits. Consequently, a conventional decoding device requires a table having a very large capacity.